#include <catch2/catch.hpp>

#include "solution.hpp"

using namespace solution_063;

TEST_CASE("063_unique_paths_ii", "[063]") {
    SECTION("example 1") {
        std::vector< std::vector<int> > grid{{0,0,0},{0,1,0},{0,0,0}};
        CHECK(Solution().uniquePathsWithObstacles(grid) == 2);
    }
    SECTION("example 2") {
        std::vector< std::vector<int> > grid{{0,1},{0,0}};
        CHECK(Solution().uniquePathsWithObstacles(grid) == 1);
    }
    SECTION("example 4") {
        std::vector< std::vector<int> > grid{{0}};
        CHECK(Solution().uniquePathsWithObstacles(grid) == 1);
    }
    SECTION("example 4") {
        std::vector< std::vector<int> > grid{{0,1},{0,0}};
        CHECK(Solution().uniquePathsWithObstacles(grid) == 1);
    }
    SECTION("example 5") {
        std::vector< std::vector<int> > grid{{1,0}};
        CHECK(Solution().uniquePathsWithObstacles(grid) == 0);
    }
    SECTION("example 5") {
        std::vector< std::vector<int> > grid{{0,0}};
        CHECK(Solution().uniquePathsWithObstacles(grid) == 1);
    }
}
